<?php

namespace app\controllers;

use Yii;

class DaddyCallController extends AuthController {
    public $currentHeader = 'header-tools';
    public $currentNav = 'daddy-call-nav';
    public $pageTitle = '';

    public function init() {
        parent::init();
    }

    public function actionIndex() {
        $this->pageTitle = 'DaddyCall';
        return $this->show();
    }

    public function actionImportData() {
        $result = $this->service->getImportData();
        if (is_array($result)) {  
            $result = $this->service->getRef($result);
            $this->OK($this->t('console', 'Update file successfully!'), 'ok', $result);
        }
        $this->NG($result);        
    }

    public function actionGetCreativeInfo () {
        $return = $this->service->getCreativeInfo();
        $this->jsonReturn($return);
    }

    public function actionSolutionCostImport() {
        $return = $this->service->saveImportData();
    }

}// end of home controller
